import request from "admin/api/request";

let baseUrl = request.httpUrl["user-api"];

export function getSchoolList(data) {
    return request({
        apiName: "请求学校列表",
        url: `${baseUrl}/edu/school/page`,
        method: "get",
        data,
    });
}

export function addSchool(data) {
    return request({
        apiName: "添加学校信息",
        url: `${baseUrl}/edu/school/save`,
        method: "post",
        data,
    });
}

export function getSchool(data) {
    return request({
        apiName: "获取学校信息",
        url: "/school/info",
        method: "get",
        data,
    });
}

export function updateSchool(data) {
    return request({
        apiName: "更新学校信息",
        url: `${baseUrl}/edu/school/update`,
        method: "put",
        data,
    });
}

export function updateRestConfig(data) {
    return request({
        apiName: "更新内存配置",
        url: "/school/rest_config",
        method: "put",
        data,
    });
}

export function dataSynchronize(data) {
    return request({
        apiName: "企微数据同步",
        url: `${baseUrl}/edu/school/data_synchronize`,
        method: "get",
        data,
    });
}

export function updateSync(params) {
    return request({
        apiName: "同步企业微信学校数据",
        url: "/school/sync",
        method: "post",
        params,
    });
}

//海康学生数据同步
export function syncHikAllStudent(params) {
    return request({
        apiName: "海康学生数据同步",
        url: `${request.httpUrl["yyc-hk"]}/hikStudent/syncHikAllStudent/${params}`,
        method: "post",
    });
}

export function batchAccessMessageAuthorize(data) {
    return request({
        apiName: "获取班级列表",
        url: "/student/batch_access_message_authorize",
        method: "put",
        data,
    });
}

export function getClassTree(params) {
    return request({
        apiName: "获取班级列表tree结构数据",
        url: "/level/tree",
        method: "get",
        params,
    });
}

export function getClassTreeList(params) {
    return request({
        apiName: "获取班级列表(学生)",
        url: `${request.httpUrl["user-api"]}/edu/student/level_tree`,
        method: "get",
        params,
    });
}

export function getClassCircleTreeList(params) {
    return request({
        apiName: "获取班级列表(班级圈)",
        url: `${request.httpUrl["user-api"]}/edu/class_circle/level_tree`,
        method: "get",
        params,
    });
}

export function getStudentApproveTreeList(params) {
    return request({
        apiName: "获取班级列表(请假)",
        url: `${request.httpUrl["user-api"]}/edu/student_approve/level_tree`,
        method: "get",
        params,
    });
}

export function getStudentName(params) {
    return request({
        apiName: "获取学生信息",
        url: `${request.httpUrl["user-api"]}/edu/student/like_name`,
        method: "get",
        params,
    });
}

export function sendParentMessage(data) {
    return request({
        apiName: "发送家长信息",
        url: `${request.httpUrl["user-api"]}/edu/student/send_parent_message`,
        method: "post",
        data,
    });
}

export function getHikStudent(params) {
    return request({
        apiName: "学生同步情况、授权情况分页列表",
        url: `${request.httpUrl["yyc-hk"]}/hikStudent/page`,
        method: "get",
        params,
    });
}

export function sendStucampusrecord(data) {
    return request({
        apiName: "保存学生校园应用授权",
        url: `${request.httpUrl["yyc"]}/stucampusrecord/save`,
        method: "post",
        data,
    });
}

export function loadStudentStatus(params) {
    return request({
        apiName: "查看学生推送情况",
        url: `${request.httpUrl["yyc-hk"]}/hikSchoolPushMess/loadStudentStatus/${params.eduId}`,
        method: "get",
        params,
    });
}